import request from '@/utils/request'

// 创建折扣商品
export function createDisGoods(data) {
  return request({
    url: '/qd/dis-goods/create',
    method: 'post',
    data: data
  })
}

// 更新折扣商品
export function updateDisGoods(data) {
  return request({
    url: '/qd/dis-goods/update',
    method: 'put',
    data: data
  })
}

// 删除折扣商品
export function deleteDisGoods(id) {
  return request({
    url: '/qd/dis-goods/delete?id=' + id,
    method: 'delete'
  })
}

// 获得折扣商品
export function getDisGoods(id) {
  return request({
    url: '/qd/dis-goods/get?id=' + id,
    method: 'get'
  })
}

// 获得折扣商品分页
export function getDisGoodsPage(query) {
  return request({
    url: '/qd/dis-goods/page',
    method: 'get',
    params: query
  })
}

// 导出折扣商品 Excel
export function exportDisGoodsExcel(query) {
  return request({
    url: '/qd/dis-goods/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
